#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time: 2022/12/28 14:51
# @Author: hekang
# @Email: 591785757@qq.com
# @File：creat_case.py
from cases.base_case import BaseCase
from pages.home_page import HomePage
from tools import screencap
from pages.works_page import WorksPage
from pages.recipes_page import RecipesPage
from time import sleep


class CreatCase(BaseCase):
    def setUp(self):
        title = "1"
        content = "啊"
        # 调用父类函数
        super().setUp()
        screencap.screenshots()
        # 实例化用例所需类
        hp = HomePage(self.driver)
        rp = RecipesPage(self.driver)
        wp = WorksPage(self.driver)
        hp.add_logo()
        sleep(1)
        hp.add_recipes()
        sleep(1)
        rp.recipes_cover()
        wp.all_videos()
        sleep(1)
        wp.screenshots()
        sleep(1)
        wp.picture1()
        sleep(1)
        wp.next1()
        sleep(1)
        wp.next2()
        rp.recipes_title(title)
        sleep(1)
        rp.recipes_content(content)
        sleep(1)
        rp.recipes_next()

    def tearDown(self):
        sleep(2)
        self.driver.quit()
